export function jointOrderIds(type, id, multipleSelection, message, str) { // 校验批量操作
  var ids = [];
  if (type === 'one') {
    ids.push(id);
  } else {
    if (multipleSelection.length < 1) {
      message.warning('Please select at least one option');
      return false;
    }
    if (type === 'more') {
      if (str) { // 组合订单内商品id
        for (var i = 0; i < multipleSelection.length; i++) {
          multipleSelection[i].orderDetails.forEach(item => {
            ids.push(item.id);
          });
        }
      } else { // 组合订单id或者商品列表id
        multipleSelection.forEach(item => {
          ids.push(item.order ? item.order.id : item.product.id);
        });
      }
    } else if (type === 'default') {
      ids = multipleSelection.map(item => item.id);
    }
  }
  return ids;
}
